<ui:composition xmlns:p='http://primefaces.org/ui'
                xmlns:h='http://java.sun.com/jsf/html'
                xmlns:ui='http://java.sun.com/jsf/facelets'>

<p:fieldset id='#{bean.name}Form' styleClass='ui-shadow ui-Form' rendered='#{bean.form}'>

<p:toolbar styleClass='toolBar'>

<p:toolbarGroup style='width: 100%; height: 15px'>

  <h:outputText value='CODIGO #{bean.entity.id}' rendered='#{!bean.entityHasCode}'/>

  <h:outputText value='CODIGO #{bean.entity.codigo}' rendered='#{ bean.entityHasCode}'/>


  <p:commandLink   title='Cancelar'  actionListener='#{bean.uiForm}'  update='@(.#{bean.name})'

  styleClass='ui-dialog-titlebar-close' style='float: right'><span class='ui-icon ui-icon-closethick'/></p:commandLink>

</p:toolbarGroup>

</p:toolbar>


<h:panelGrid columns='#{columns != null? columns : 1}' cellpadding='#{cellpadding != null? cellpadding : 8}' style="margin-bottom: #{bean.entity.id == null? '8px' : '20px'}">

  <ui:param name='bean' value='#{bean}'/>

  <ui:param name='e' value='#{bean.entity}'/>

  <ui:insert/>

</h:panelGrid>

</p:fieldset><p:draggable for='#{bean.name}Form'/>

</ui:composition>